package com.atguigu.dao.impl;

import com.atguigu.dao.OrderDao;
import com.atguigu.pojo.Order;

import java.util.Random;

/**
 * @author Chen
 * @Description
 * @Version
 * @create 2021-11-17-21:55
 */
public class OrderDaoImp extends BaseDao implements OrderDao {

    /**
     *
     * @param order
     * @return
     */
    @Override
    public int saveOrder(Order order) {
        new Random();
        String sql = "insert into t_order(order_id, create_time, price, status, user_id) values(?, ?, ?, ?, ?)";
        return update(sql, order.getOrderId(), order.getCreateTime(), order.getPrice(), order.getStatus(), order.getUserId());
    }
}
